package br.com.firula.to;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity  
@Table(name="log")  
public class LogTO extends BaseTO {
    private static final long serialVersionUID = 3256446889040622647L;
 
	@Id
	@Column(name="id", nullable=false) 
	@SequenceGenerator(name="id",sequenceName="log_sequence",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id")
	private Long id;
	
	@Column(columnDefinition="text")
    private String action;
    
    @Column(columnDefinition="text")
    private String param;
    
	@Column
	private Long idUsuario;
	
	@Column
	private Long idPedido;

	@Column
	private String ip;
	
	@Column(columnDefinition="text")
	private String sessionId;
	
	@Column
	private Double timeInMillis;
	
	@Column
	private int activeSessions;

	@Column(columnDefinition="text")
	private String url;
	
	@Column(columnDefinition="text")
	private String uri;
	
	@Column(columnDefinition="text")
	private String cookieVisit;
	
	@Column(columnDefinition="text")
	private String cookieUniqueVisit;
	
	@Column
	private Long cookieVisitMaxAge;
	
	@Column
	private Long cookieUniqueVisitMaxAge;
	
	@Column
	private Boolean cookieVisitNew;

	@Column
	private Boolean cookieUniqueVisitNew;
	
	@Column(columnDefinition="text")
	private String referer;
	
	@Column
	private Long idEmpresa;
	
	@Column(columnDefinition="text")
	private String userAgent;
	
	public Double getTimeInMillis() {
		return timeInMillis;
	}

	public void setTimeInMillis(Double timeInMillis) {
		this.timeInMillis = timeInMillis;
	}

	@Override
	public String getAbreviation() {
		return id.toString();
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getIdPedido() {
		return idPedido;
	}

	public void setIdPedido(Long idPedido) {
		this.idPedido = idPedido;
	}

	public Long getIdUsuario() {
		return idUsuario;
	}

	public void setIdUsuario(Long idUsuario) {
		this.idUsuario = idUsuario;
	}

	public String getParam() {
		return param;
	}

	public void setParam(String param) {
		this.param = param;
	}

	public String getIP() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getSessionId() {
		return sessionId;
	}

	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}

	public int getActiveSessions() {
		return activeSessions;
	}

	public void setActiveSessions(int activeSessions) {
		this.activeSessions = activeSessions;
	}

	public String getCookieVisit() {
		return cookieVisit;
	}

	public void setCookieVisit(String cookieVisit) {
		this.cookieVisit = cookieVisit;
	}

	public String getCookieUniqueVisit() {
		return cookieUniqueVisit;
	}

	public void setCookieUniqueVisit(String cookieUniqueVisit) {
		this.cookieUniqueVisit = cookieUniqueVisit;
	}

	public Long getCookieVisitMaxAge() {
		return cookieVisitMaxAge;
	}

	public void setCookieVisitMaxAge(Long cookieVisitMaxAge) {
		this.cookieVisitMaxAge = cookieVisitMaxAge;
	}

	public Long getCookieUniqueVisitMaxAge() {
		return cookieUniqueVisitMaxAge;
	}

	public void setCookieUniqueVisitMaxAge(Long cookieUniqueVisitMaxAge) {
		this.cookieUniqueVisitMaxAge = cookieUniqueVisitMaxAge;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getUri() {
		return uri;
	}

	public void setUri(String uri) {
		this.uri = uri;
	}

	public Boolean getCookieVisitNew() {
		return cookieVisitNew;
	}

	public void setCookieVisitNew(Boolean cookieVisitNew) {
		this.cookieVisitNew = cookieVisitNew;
	}

	public Boolean getCookieUniqueVisitNew() {
		return cookieUniqueVisitNew;
	}

	public void setCookieUniqueVisitNew(Boolean cookieUniqueVisitNew) {
		this.cookieUniqueVisitNew = cookieUniqueVisitNew;
	}

	public String getReferer() {
		return referer;
	}

	public void setReferer(String referer) {
		this.referer = referer;
	}

	public String getUserAgent() {
		return userAgent;
	}

	public void setUserAgent(String userAgent) {
		this.userAgent = userAgent;
	}

	public Long getIdEmpresa() {
		return idEmpresa;
	}

	public void setIdEmpresa(Long idEmpresa) {
		this.idEmpresa = idEmpresa;
	}

	public String getIp() {
		return ip;
	}
}